import Vue from 'vue'
import App from './App.vue'
import router from './router'
import '@/assets/global.css'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/icon/iconfont.css'
import axios from "axios";
import {Message} from "element-ui";
import 'default-passive-events'
import store from "@/store";

Vue.prototype.$message = Message

Vue.config.productionTip = false
axios.defaults.baseURL = "http://8.152.4.101:9999/"    //基础访问路径，布署时需要更改
// axios.defaults.baseURL = "http://localhost:9999/"    //基础访问路径，布署时需要更改
axios.interceptors.request.use(config =>{
  //即在请求头上添加证书(授权)Authorization属性，属性值即为token值，这样每次请求会自动加上token信息
  config.headers.Authorization = window.sessionStorage.getItem("token");
  return config;
})

Vue.prototype.$http = axios;  //$http  就是一个全局变量（挂载到了Vue对象上）

Vue.use(ElementUI);


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
